package com.huaqing.manage.service.impl;

import java.util.List;
import com.huaqing.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.huaqing.manage.mapper.MaterialRecordMapper;
import com.huaqing.manage.domain.MaterialRecord;
import com.huaqing.manage.service.IMaterialRecordService;

/**
 * 仓库管理Service业务层处理
 * 
 * @author cdutTang
 * @date 2025-02-28
 */
@Service
public class MaterialRecordServiceImpl implements IMaterialRecordService 
{
    @Autowired
    private MaterialRecordMapper materialRecordMapper;

    /**
     * 查询仓库管理
     * 
     * @param recordId 仓库管理主键
     * @return 仓库管理
     */
    @Override
    public MaterialRecord selectMaterialRecordByRecordId(Long recordId)
    {
        return materialRecordMapper.selectMaterialRecordByRecordId(recordId);
    }

    /**
     * 查询仓库管理列表
     * 
     * @param materialRecord 仓库管理
     * @return 仓库管理
     */
    @Override
    public List<MaterialRecord> selectMaterialRecordList(MaterialRecord materialRecord)
    {
        return materialRecordMapper.selectMaterialRecordList(materialRecord);
    }

    /**
     * 新增仓库管理
     * 
     * @param materialRecord 仓库管理
     * @return 结果
     */
    @Override
    public int insertMaterialRecord(MaterialRecord materialRecord)
    {
        materialRecord.setCreateTime(DateUtils.getNowDate());
        return materialRecordMapper.insertMaterialRecord(materialRecord);
    }

    /**
     * 修改仓库管理
     * 
     * @param materialRecord 仓库管理
     * @return 结果
     */
    @Override
    public int updateMaterialRecord(MaterialRecord materialRecord)
    {
        return materialRecordMapper.updateMaterialRecord(materialRecord);
    }

    /**
     * 批量删除仓库管理
     * 
     * @param recordIds 需要删除的仓库管理主键
     * @return 结果
     */
    @Override
    public int deleteMaterialRecordByRecordIds(Long[] recordIds)
    {
        return materialRecordMapper.deleteMaterialRecordByRecordIds(recordIds);
    }

    /**
     * 删除仓库管理信息
     * 
     * @param recordId 仓库管理主键
     * @return 结果
     */
    @Override
    public int deleteMaterialRecordByRecordId(Long recordId)
    {
        return materialRecordMapper.deleteMaterialRecordByRecordId(recordId);
    }
}
